package com.dl698.axdr;

/**
 * MS选择枚举
 * 定义MS数据类型的选择值
 * 
 * @author wind
 * @version 1.1.1
 */
public enum MSChoice {
    _ERR_NONE_SELECTED(-1),
    NOM(0),
    ALLMADDR(1),
    GROUPMTYPE(2),
    GROUPMADDR(3),
    GROUPSETINDEX(4),
    REGIONTYPE(5),
    REGIONADDR(6),
    REGIONSETINDEX(7);

    private final int value;

    MSChoice(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    public static MSChoice fromValue(long value) {
        for (MSChoice choice : MSChoice.values()) {
            if (choice.value == value) {
                return choice;
            }
        }
        throw new IllegalArgumentException("No MSChoice with value: " + value);
    }
}